#include <iostream>
#include <sstream>
#include "utils/HardwareInfo.h"

int main() {
    std::string deviceSn = ems::utils::HardwareInfo::getDeviceId();
    std::string deviceType = "32764";
    
    // 模拟登录消息
    std::ostringstream ss;
    ss << "{\"cmdId\":101,\"seq\":123456"
       << ",\"gwId\":\"ems-" << deviceSn << "\",\"errorCode\":0,\"data\":{"
       << "\"deviceType\":" << deviceType << ",\"random\":1234}}";
    
    std::cout << "Device SN: " << deviceSn << std::endl;
    std::cout << "MQTT gwId will be: ems-" << deviceSn << std::endl;
    std::cout << "\nSample MQTT Login Message:" << std::endl;
    std::cout << ss.str() << std::endl;
    
    // 模拟数据上报消息
    std::ostringstream ss2;
    ss2 << "{\"cmdId\":312,\"gwId\":\"ems-" << deviceSn << "\",\"data\":{\"time\":1726132139"
        << ",\"dSn\":\"" << deviceSn << "\"}}";
    
    std::cout << "\nSample MQTT Data Message:" << std::endl;
    std::cout << ss2.str() << std::endl;
    
    return 0;
}